package com.orhon.smartcampus.modules.systemctl.mm;

import java.util.List;

import com.orhon.smartcampus.modules.base.mm.*;
import com.orhon.smartcampus.modules.course.mm.CoursesMapper;
import com.orhon.smartcampus.modules.systemctl.gqlModel.GQLSchoolSettings;
import org.mapstruct.InheritConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import com.orhon.smartcampus.modules.systemctl.entity.Schoolsettings;

@Mapper(
        uses = {
                LangMapper.class,
                SchoolMapper.class,
                GradeMapper.class,
                PeriodMapper.class,
                SubjectMapper.class,
                CoursesMapper.class,
                DutiesMapper.class
        }
)
public interface SchoolSettingsMapper {

    SchoolSettingsMapper MAPPER = Mappers.getMapper(SchoolSettingsMapper.class);

    @Mappings({
            @Mapping(source = "id" , target = "id"),
            @Mapping(source = "platformName" , target = "platformName"),
            @Mapping(source = "logo" , target = "logo"),
            @Mapping(source = "favicon" , target = "favicon"),
            @Mapping(source = "themeSettings" , target = "themeSettings"),
            @Mapping(source = "createdAt" , target = "createdAt"),
            @Mapping(source = "updatedAt" , target = "updatedAt"),
            @Mapping(source = "deletedAt" , target = "deletedAt"),
            @Mapping(ignore = true, source = "baseSchoolsBySchoolId" , target = "school"),
            @Mapping(ignore = true, source = "grades" , target = "grades"),
            @Mapping(ignore = true, source = "periods" , target = "periods"),
            @Mapping(ignore = true, source = "subjects" , target = "subjects"),
            @Mapping(ignore = true, source = "courses" , target = "courses"),
            @Mapping(ignore = true, source = "duties" , target = "duties"),
    })
    GQLSchoolSettings toSchoolsettings(Schoolsettings entity);

    @InheritConfiguration(name = "toSchoolsettings")
    List<GQLSchoolSettings> toSchoolsettingsList(List<Schoolsettings> entities);

//    @Mapping(source ="id" , target = "id")
//    @Mapping(source ="platformName" , target = "platform_name")//lang
//    @Mapping(source ="grades" , target = "grades")
//    @Mapping(source ="periods" , target = "periods")
//    @Mapping(source ="subjects", target = "subjects")
//    @Mapping(source ="duties" , target = "duties")
//    @Mapping(source ="courses" , target = "courses")
//    @Mapping(source ="logo" , target = "dutilogoes")
//    @Mapping(source ="favicon" , target = "favicon")
//    @Mapping(source ="themeSettings" , target = "theme_settings")
//    @Mapping(source ="meta" , target = "meta")
//    @Mapping(target = "school" , ignore = true)
//    GQLSchoolSettingss toSchoolsettings(Schoolsettings moduleentity);
//
//    @InheritConfiguration(name = "toSchoolsettings")
//    List<GQLSchoolSettingss> toSchoolsettingsList(List<Schoolsettings> entities);
//
//    @Mapping(source ="id" , target = "id")
//    @Mapping(source ="platformName" , target = "platform_name")//lang
//    @Mapping(ignore = true , target = "grades")
//    @Mapping(source ="periods" , target = "periods")
//    @Mapping(ignore = true , target = "subjects")
//    @Mapping(ignore = true , target = "duties")
//    @Mapping(source ="courses" , target = "courses")
//    @Mapping(source ="logo" , target = "dutilogoes")
//    @Mapping(source ="favicon" , target = "favicon")
//    @Mapping(source ="themeSettings" , target = "theme_settings")
//    @Mapping(source ="meta" , target = "meta")
//    @Mapping(target = "school" , ignore = true)
//    GQLSchoolSettings toSchoolsetting(Schoolsettings moduleentity);

}
